# coding: utf-8
import random, datetime
import sys
reload(sys)

sys.setdefaultencoding('utf8')

def create_student_sc_dict(start):
    filename = str(start) + '.txt'
    print filename
    with open('./' + filename, mode='wr+') as fp:
        for i in xrange(start * 40000, (start + 1) * 40000):
            course = random.sample([u'数学', u'数学', u'数学', u'数学',
                                    u'语文', u'英语', u'化学', u'物理', u'生物'], 1)[0]
            model = {"s_no": u"xuehao_no_" + str(i),
                     "course": u"{0}".format(course),
                     "op_datetime": datetime.datetime.now().strftime("%Y-%m-%d"),
                     "reason": u"非常非常非常非常细化{0}".format(course)
                     }
            fp.write("{0}\t{1}\t{2}\t{3}\n".format(
                model['s_no'], model['course'],
                model['op_datetime'], model['reason']
            ))

for i in xrange(1, 501):
    starttime = datetime.datetime.now()
    create_student_sc_dict(i)